#include <iostream>  
using namespace std;

int main() {  
	int totalheads = 50;  
	int totalfeet = 120;  
	int chicken,rabbits,currentfeet;
	bool found = false; // 标记是否找到解决方案  
	// 穷举所有可能的鸡的数量  
	for (chicken = 0; chicken <= totalheads; chicken++) {  
		rabbits = totalheads - chicken; // 计算出对应的兔子的数量  
		currentfeet = 2 * chicken + 4 * rabbits; // 计算出当前组合下的脚的总数  
		
		// 检查是否满足脚的总数条件  
		if (currentfeet == totalfeet) {  
			found = true;  
			break; // 找到解，跳出循环  
		}  
	}  
	
	if (found) {  
		cout << "鸡有 " << chicken << " 只，兔有 " << rabbits << " 只。" << endl;  
	} else {  
		cout << "没有找到符合条件的鸡和兔的数量。" << endl;  
	}  
	
	return 0;  
}
